home *** CD-ROM | disk | FTP | other *** search
- /*
- File: MouseModule.h
-
- Contains: Header file for mouse module
-
- Version: xxx put version here xxx
-
- Copyright: © 1997-1998 by Apple Computer, Inc., all rights reserved.
-
- */
- #ifndef __MouseModuleH__
- #define __MouseModuleH__
-
- #include <Types.h>
- #include <Devices.h>
- #include <DriverServices.h>
- #include <Processes.h>
- #include <CursorDevices.h>
- #include <USB.h>
-
- Boolean immediateError(OSStatus err);
- void MouseModuleInitiateTransaction(USBPB *pb);
- void MouseModuleDelayCompletionProc(USBPB *pb);
- void TransactionCompletionProc(USBPB *pb);
- void InterfaceEntry(UInt32 interfacenum, USBInterfaceDescriptorPtr pInterfaceDescriptor, USBDeviceDescriptorPtr pDeviceDescriptor, USBDeviceRef device);
-
- /* Prototypes from MouseModuleHeader.c Tue, Mar 17, 1998 3:30:22 PM */
- static OSStatus MouseModuleInitialize(USBDeviceRef device, USBDeviceDescriptorPtr pDesc, UInt32 busPowerAvailable);
- static OSStatus MouseInterfaceInitialize(UInt32 interfacenum, USBInterfaceDescriptorPtr pInterface, USBDeviceDescriptorPtr pDesc, USBDeviceRef device);
- static OSStatus MouseModuleFinalize(USBDeviceRef theDeviceRef, USBDeviceDescriptorPtr pDesc);
-
-
- /* Prototypes from MouseConfigParse.c Tue, Mar 17, 1998 3:17:14 PM */
- OSErr FindHIDInterfaceByNumber(LogicalAddress pConfigDesc, UInt32 ReqInterface, USBInterfaceDescriptorPtr * hInterfaceDesc);
-
- OSStatus USBHIDControlDevice(UInt32 theControlSelector, void * theControlData);
- void NotifyRegisteredHIDUser(UInt32 devicetype, UInt8 hidReport[]);
-
- void USBMouseIn(UInt32 refcon, void * theData);
- void InitParamBlock(USBDeviceRef theDeviceRef, USBPB * paramblock);
-
- #define kMouseRetryCount 3
-
- enum driverstages
- {
- kUndefined = 0,
- kGetFullConfiguration,
- kFindInterfaceAndSetProtocol,
- kSetIdleRequest,
- kFindAndOpenInterruptPipe,
- kReadInterruptPipe,
- kReturnFromDriver = 0x1000,
- kRetryTransaction = 0x2000,
- kSyncTransaction = 0x4000,
- kCompletionPending = 0x8000
- };
-
- typedef struct
- {
- USBPB pb;
- void (*handler)(USBPB *pb);
-
- USBDeviceRef deviceRef;
- USBInterfaceRef interfaceRef;
- USBPipeRef pipeRef;
-
- USBDeviceDescriptor deviceDescriptor;
- USBInterfaceDescriptor interfaceDescriptor;
-
- USBConfigurationDescriptorPtr pFullConfigDescriptor;
- USBInterfaceDescriptorPtr pInterfaceDescriptor;
- USBEndPointDescriptorPtr pEndpointDescriptor;
-
- UInt32 hidDeviceType;
- UInt8 hidReport[64];
-
- HIDInterruptProcPtr pSHIMInterruptRoutine;
- HIDInterruptProcPtr pSavedInterruptRoutine;
-
- UInt32 interruptRefcon;
-
- SInt32 retryCount;
- SInt32 transDepth;
-
- CursorDevicePtr pCursorDeviceInfo;
- CursorDevice cursorDeviceInfo;
- Fixed unitsPerInch;
- } usbMousePBStruct;
-
- #endif //__MouseModuleH__